Caption = "Path to the VB.EXE (will be copied to VB.001 before patch is applied)"
Height = 255
Left = -30
TabIndex = 4
Top = 2850
Width = 7515
End
Begin Label Label2
Alignment = 2 'Center
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
Caption = "The code used in this application was copied from a message by Art Rothstein, 70353,47. This information is provided so that proper credit may be assigned. It does not mean, however that Art has any responsibility for the success or failure of the patch. In other words, ""Use at your own risk!"" The program was written by Chris Monro, 74250,1327"
ForeColor = &H00FFFF00&
Height = 1035
Left = 240
TabIndex = 2
Top = 1770
Width = 7065
End
Begin Label Label1
Alignment = 2 'Center
BackColor = &H00C0C0C0&
Caption = "This program patches a backup copy of the VB for Windows version 3.0 executable to increase the available stack size for compiled applications from 20K to 40K. Enter the full path of the EXE and Stack Patch will copy the file to VB.001 and make the patch against it. You should close VB and copy the ""old"" VB.EXE to a safe place or rename the file, to keep as a backup copy. Next, rename or copy the VB.001 to VB.EXE. MAKE certain that you save a copy of the pre-patched version of VB.EXE just in case. Stack Patch will notify you of the success or failure of the patch."
Height = 1665
Left = 600
TabIndex = 1
Top = 150
Width = 6525
End
End
Sub Command1_Click ()
On Error GoTo FileError
If Right$(Text1.Text, 6) <> "VB.EXE" Then MsgBox "You didn't provide the proper path and name of the VB.EXE. Try again.": Exit Sub
Screen.MousePointer = 11
Length = Len(Text1.Text) - 3
VBPath = Text1.Text
Text1.Text = "Making backup of VB.EXE"
Text1.Refresh
DestFile = Left$(VBPath, Length) & "001"
FileCopy VBPath, DestFile
Text1.Text = "Patching VB.001"
Text1.Refresh
Open DestFile For Binary Access Read Write As #1
Get #1, 1555, StackVB%
Get #1, 82743, StackCompiled%
Get #1, 101254, Checksum%
If StackVB% <> &H5000 Then GoTo ValidationError
If StackCompiled% <> &H5000 Then GoTo ValidationError
If Checksum% <> &HBC57 Then GoTo ValidationError
StackVB% = &HA000
StackCompiled% = &HA000
Checksum% = &H1282
Put #1, 1555, StackVB%
Put #1, 82743, StackCompiled%
Put #1, 101254, Checksum%
MsgBox "Patch successful"
Screen.MousePointer = 0
Text1.Text = VBPath
Exit Sub
ValidationError:
MsgBox "Validation failure"
Screen.MousePointer = 0
Text1.Text = VBPath
Exit Sub
FileError:
Select Case Err
Case Else: MsgBox "An error occurred while running Stack Patch. The error number is: " & Err: Screen.MousePointer = 0: Text1.Text = "ERROR": Exit Sub